<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/tweeningparameter.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<META http-equiv="Content-Type" content="text/html; charset=">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Tweener Documentation and Language Reference</title>
<!-- InstanceEndEditable -->
<link href="../style.css" rel="stylesheet" type="text/css">
<link href="../print.css" rel="stylesheet" type="text/css" media="print">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --><!-- InstanceParam name="OptionalSeeAlso" type="boolean" value="true" --><!-- InstanceParam name="OptionalNotes" type="boolean" value="false" -->
</head>
<body>
<div id="header">
  <p>Tweener Documentation</p>
  <h1><!-- InstanceBeginEditable name="PageType" -->Reference &raquo; Tweening Parameters<!-- InstanceEndEditable --></h1>
</div>
<div class="detailBody">
  <h1><!-- InstanceBeginEditable name="ParameterName" -->onError<!-- InstanceEndEditable --></h1>
  <h4>Availability</h4>
  <!-- InstanceBeginEditable name="DetailAvailability" -->
  <p>AS2 and AS3.</p>
  <!-- InstanceEndEditable -->
  <h4>Usage</h4>
  <pre><!-- InstanceBeginEditable name="DetailUsage" -->... onError:value<!-- InstanceEndEditable -->, ...</pre>
  <h4>Parameters</h4>
  <!-- InstanceBeginEditable name="DetailParameters" -->
  <p><code>value</code>:Function &mdash; A function that gets called when an error occurs when trying to run a tweening. This is used to handle errors more commonly thrown by other events (that is, from code not controlled by Tweener), such as <code>onStart</code>, <code>onUpdate</code> or <code>onComplete</code>. The function scope (in which the event is executed) is the target object itself, unless specified by the <code><a href="onErrorScope.html">onErrorScope</a></code> parameter.</p>
  <p>This parameter is more useful on ActionScript 3 than on ActionScript 2, since errors tend to be silent on AS2.</p>
  <!-- InstanceEndEditable -->
  <h4>Examples</h4>
  <!-- InstanceBeginEditable name="DetailExamples" -->
<pre>// Tweens an object, outputting what's wrong if an error occurs on any event (AS3)
this.handleError = function(errorScope:Object, metaError:Error) {
	trace (&quot;Warning! Object &quot; + errorScope + &quot; has thrown an error: &quot; + metaError);
};
this.someCrazyFunction = function() {
	// This function must do something to throw an error that will be caught by onError
	// One example would be referring to a property of a null object
	var whatever:Object = null;
	var whatever2 = whatever.someProperty;
};
Tweener.addTween(this.box, {x:100, time:1, onUpdate:this.someCrazyFunction, onError:this.handleError});</pre>
<!-- InstanceEndEditable -->
  
  
  <h4>See also</h4>
  <!-- InstanceBeginEditable name="DetailsSeeAlso" -->
  <p><a href="onErrorScope.html">onErrorScope</a></p>
  <!-- InstanceEndEditable --></div>
</body>
<!-- -->
<!-- InstanceEnd --></html>
